|
|
|
|
|
|
|
Figure 14.37
Surfaces of revolution with base curves drawn in heavy lines. |
|
|
|
|
|
|
|
|
The Transformed3d class manages these kinds of surfaces of transformation. Like the Extrusion3d and Rotated3d classes, Transformed3d stores the points that define its base curve using an array of points and an AddCurvePoint method. |
|
|
|
|
|
|
|
|
The class stores transformation matrices in its Transformations array. Its SetTransformation method allows a program to define these matrices. |
|
|
|
|
|
|
|
|
Finally, the Transform subroutine applies the transformations to the object's base curve to produce the line segments representing the surface. For each transformation in the Trans array, the object transforms the curve and adds the transformed version to its display polyline object. It also connects the points in the transformed version to the corresponding points in the previous version. |
|
|
|
 |
|
|
|
|
Option Explicit
Private NumCurvePts As Integer
Private CurvePoints() As Point3D
Private NumTransformations As Integer
Private Transformations() As Transformation
Private ThePolyline As Polyline3d ' The display polyline.
' Set a transformation. Public Sub SetTransformation(M() As Single)
NumTransformations = NumTransformations + 1
ReDim Preserve Transformations(1 To NumTransformations)
m3MatCopy Transformations(NumTransformations).M, M
End Sub
' Create the display polyline by applying the
' series of transformations in array M(). Public Sub Transform()
Dim i As Integer |
|
|
|
|
|